<template>
  <search title="请输入使用的信息"/>

  <view v-for="k in data" :key="k" class="record-box">
    <view class="record-left">
      <notice
          :title="k.title"
          :time="k.time"
          :people="k.people"
          :content="k.content"
      />
    </view>

    <view class="record-right">
      <view v-if="k.valid">
        <text class="record-text valid">已登记</text>
        <button type="primary" class="record-button">评价</button>
      </view>
      <view v-else>
        <text class="record-text invalid">未登记</text>
      </view>
    </view>
  </view>

  <Under :selected="3"/>
</template>

<script setup lang="ts">
import Search from "@/components/head/search.vue";
import Under from "@/components/tail/under.vue";
import Notice from "@/components/card/notice.vue";
import {onMounted, reactive} from "vue";
import axios from "axios";

let data = reactive([])

onMounted(()=>{
  axios.get("http://localhost:24154/api/record/data").then((resp)=>{
    if (resp.status===200 && resp.data["title"]){
      data.push(resp.data)
    }
  })
})
</script>
